import Vue from 'vue'
// import App from './App.vue'
import router from './router'
import store from './store'
import Message from '@/plugins/message-box'
import lstore from '@/plugins/lstore'
import './style/app.less'
import './icons/index.js'
import './icons/iconfont.js'
import './utils/flexible.js'
import './registerServiceWorker'

import App from './app.js'
import bus from './bus'
import http from './api/api'
import mixin from './mixin.js'
import * as filters from './filters.js'
import components from './components.js'

Vue.mixin(mixin)

// vant 全局组件
import enUS from 'vant/es/locale/lang/en-US'
import { Locale, Button, Dialog, Icon, Toast } from 'vant'
Locale.use('en-US', enUS)

components.forEach(component => {
  Vue.component(component.name, component)
})

Vue.config.productionTip = false

Vue.prototype.$bus = bus
Vue.prototype.$http = http
Vue.prototype.$toast = Toast
Vue.prototype.$Dialog = Dialog
Vue.prototype.$Message = Message

Vue.use(lstore)
Vue.use(Button)
Vue.use(Icon)
for (const k in filters) {
  Vue.filter(k, filters[k])
}

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
